#ifndef _I2C_H_
#define _I2C_H_

#include <STC15F2K60S2.H>
#include "intrins.h"

#define DELAY_TIME 5

//总线引脚定义
sbit SDA = P2^1;  /* 数据线 */
sbit SCL = P2^0;  /* 时钟线 */

void IIC_Start(void);
void IIC_Stop(void);
bit IIC_WaitAck(void);
void IIC_SendByte(unsigned char byt);
unsigned char IIC_RecByte(void);
unsigned int ad_read(unsigned int addr);
void da_write(unsigned int dat);
void IIC_SendAck(bit ackbit);

#endif